package com.example.restaurant.common;

/*
    基于ThreadLocal封装工具类，用户保存和获取当前登录id
    以线程为单位，即 一次请求
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal= new InheritableThreadLocal<>();

    public static void setId(Long id){
        threadLocal.set(id);
    }

    public static Long get(){
        return threadLocal.get();
    }
    //

}
